<template>
  <div class="q-pa-md">
    <t-carousel
      swipeable
      animated
      arrows
      v-model="slide"
      v-model:fullscreen="fullscreen"
      infinite
    >
      <t-carousel-slide
        :name="1"
        img-src="https://cdn.quasar.dev/img/mountains.jpg"
      />
      <t-carousel-slide
        :name="2"
        img-src="https://cdn.quasar.dev/img/parallax1.jpg"
      />
      <t-carousel-slide
        :name="3"
        img-src="https://cdn.quasar.dev/img/parallax2.jpg"
      />
      <t-carousel-slide
        :name="4"
        img-src="https://cdn.quasar.dev/img/quasar.jpg"
      />

      <template v-slot:control>
        <t-carousel-control position="bottom-right" :offset="[18, 18]">
          <t-btn
            push
            round
            dense
            color="white"
            text-color="primary"
            :icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
            @click="fullscreen = !fullscreen"
          />
        </t-carousel-control>
      </template>
    </t-carousel>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        slide: ref(1),
        fullscreen: ref(false),
      };
    },
  };
</script>
